package com.lhg;

import com.lhg.pattern.creational.abstractfactory.FactoryProducer;
import com.lhg.pattern.creational.builder.Meal;
import com.lhg.pattern.creational.builder.MealBuilder;
import com.lhg.pattern.creational.factory.ShapeFactory;
//import com.lhg.pattern.creational.prototype.Shape;
import com.lhg.pattern.creational.prototype.ShapeCache;
import com.lhg.pattern.creational.singleton.Singleton;
import com.lhg.pattern.creational.singleton.Singleton5;
import com.lhg.pattern.creational.singleton.Singleton6;
import com.lhg.pattern.structural.adapter.AudioPlayer;
import com.lhg.pattern.structural.bridge.Circle;
import com.lhg.pattern.structural.bridge.GreenCircle;
import com.lhg.pattern.structural.bridge.RedCircle;
import com.lhg.pattern.structural.bridge.Shape;

/**
 * @author Admin
 */
public class App {
    public static void main(String[] args) {
        System.out.println("测试设计模式");
//        Singleton.getInstance().showMessage();
//        Singleton5.getInstance().showMessage();
//        Singleton6.INSTANCE.showMessage();

//        MealBuilder mealBuilder = new MealBuilder();
//        Meal meal = mealBuilder.prepareVegMeal();
//        meal.showItems();
//        System.out.println("meal.getCost() = " + meal.getCost());

//        Shape circle = new ShapeFactory().getShape("Circle");
//        circle.draw();
//        FactoryProducer.getFactory("Shape").getShape("Circle").draw();
//        FactoryProducer.getFactory("color").getColor("Red").fill();
//        ShapeCache.loadCache();
//        Shape clonedShape = (Shape) ShapeCache.getShape("1");
//        System.out.println("Shape : " + clonedShape.getType());

//        AudioPlayer audioPlayer = new AudioPlayer();
//        audioPlayer.play("vlc", "far far away.vlc");
//        audioPlayer.play("avi", "mind me.avi");


//        Shape redCircle = new Circle(100,100, 10, new RedCircle());
//        Shape greenCircle = new Circle(100,100, 10, new GreenCircle());
//
//        redCircle.draw();
//        greenCircle.draw()
    }
}
